@model NakedObjects.Web.Mvc.Models.FindViewModel
@using NakedObjects.Web.Mvc.Html
@using NakedObjects.Web.Mvc.Models

@{ 
    if (Model.ViewType == FindViewModel.ViewTypes.Dialog) {
         ViewBag.Title = Model.ContextAction.Name;
     } else {
         ViewBag.Title = Html.ObjectTitle(Model.ContextObject);
     }
}

@section MainContent { 
@(Html.History())   
    <div class="@(IdHelper.FindDialogName)">
        @if (Model.ViewType == FindViewModel.ViewTypes.Dialog) { 
            <div class="@(IdHelper.ActionDialogName)" id="@(Html.ObjectActionDialogId(Model.ContextObject, Model.ContextAction))">
                 @{ Html.RenderPartial("DialogControl", Model);}
  
            </div>
        } else {
            <div class="@(IdHelper.ObjectEditName)"  id="@(Html.ObjectTypeAsCssId(Model.ContextObject))">
               @{ Html.RenderPartial("ObjectEditControl", Model);}
   
            </div>
        }
    </div> 
}
